﻿/***********************************************************************
 * <copyright file="News.cs" company="VidaGIS">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Hoang Bich Son 
 * Email:    sonhb@vidagis.com or bichson2002@gmail.com
 * Website:
 * Create Date: Wednesday, November 26, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System;
using System.Collections.Generic;
using BusinessObjects;
using BusinessObjects.BusinessRules;

namespace BusinessNews
{
    /// <summary>
    /// News class
    /// </summary>
    public class News: BusinessObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="News"/> class.
        /// </summary>
        public News()
        {
            AddRule(new ValidateId("NewsId"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="News"/> class.
        /// </summary>
        /// <param name="newsId">The news identifier.</param>
        /// <param name="publishDate">The publish date.</param>
        /// <param name="newsCategoryId">The news category identifier.</param>
        /// <param name="rowguid">The rowguid.</param>
        /// <param name="modifiedDate">The modified date.</param>
        public News(long newsId, DateTime? publishDate, long? newsCategoryId, Guid? rowguid, DateTime? modifiedDate)
            : this()
        {

            NewsId = newsId;
            PublishDate = publishDate;
            NewsCategoryId = newsCategoryId;
            Rowguid = rowguid;
            ModifiedDate = modifiedDate;
        }

        /// <summary>
        /// Gets or sets the news category.
        /// </summary>
        /// <value>
        /// The news category.
        /// </value>
        public NewsCategory NewsCategory { get; set; }

        /// <summary>
        /// Gets or sets the content of the news.
        /// </summary>
        /// <value>
        /// The content of the news.
        /// </value>
        public List<NewsContent> NewsContent { get; set; }

        /// <summary>
        /// Gets or sets the news description.
        /// </summary>
        /// <value>
        /// The news description.
        /// </value>
        public List<NewsDescription> NewsDescription { get; set; }

        /// <summary>
        /// Gets or sets the news identifier.
        /// </summary>
        /// <value>
        /// The news identifier.
        /// </value>
        public long NewsId { get; set; }

        /// <summary>
        /// Gets or sets the publish date.
        /// </summary>
        /// <value>
        /// The publish date.
        /// </value>
        public DateTime? PublishDate { get; set; }

        /// <summary>
        /// Gets or sets the news category identifier.
        /// </summary>
        /// <value>
        /// The news category identifier.
        /// </value>
        public long? NewsCategoryId { get; set; }

        /// <summary>
        /// Gets or sets the rowguid.
        /// </summary>
        /// <value>
        /// The rowguid.
        /// </value>
        public Guid? Rowguid { get; set; }

        /// <summary>
        /// Gets or sets the modified date.
        /// </summary>
        /// <value>
        /// The modified date.
        /// </value>
        public DateTime? ModifiedDate { get; set; }
    }
}
